<template xmlns="http://www.w3.org/1999/html">
  <div class="app-container">
    <el-descriptions class="margin-top"  :column="2"  border>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-user"></i>
          活动名称
        </template>
        {{form.promotionName}}
      </el-descriptions-item>
      <el-descriptions-item >
        <template slot="label">
          <i class="el-icon-office-building"></i>
          活动时间
        </template>
        {{form.startTime}} - {{form.endTime}}
      </el-descriptions-item>
      <el-descriptions-item >
        <template slot="label">
          <i class="el-icon-office-building"></i>
          虚拟成团
        </template>
        <el-radio-group v-model="form.fictitious" disabled>
          <el-radio-button label="1">开启</el-radio-button>
          <el-radio-button label="0">关闭</el-radio-button>
        </el-radio-group>
      </el-descriptions-item>
      <el-descriptions-item >
        <template slot="label">
          <i class="el-icon-office-building"></i>
          参团人数
        </template>
         {{form.requiredNum}} 人
      </el-descriptions-item>

      <el-descriptions-item >
        <template slot="label">
          <i class="el-icon-office-building"></i>
          限购数量
        </template>
        {{form.limitNum}} 件
      </el-descriptions-item>


      <el-descriptions-item  >
        <template slot="label">
          <i class="el-icon-office-building"></i>
          拼团规则
        </template>
        {{form.pintuanRule}}
      </el-descriptions-item>

    </el-descriptions>
    <el-card class="box-card" style="margin-top: 20px" >
      <div slot="header" class="clearfix">
        <span>指定商品</span>
      </div>
      <div class="form-item-view">
        <el-table  :data="promotionGoodsList" >
          <el-table-column label="商品名称" align="center" prop="goodsName" />
          <el-table-column label="商品价格" align="center" prop="originalPrice" />
          <el-table-column label="团购价格" align="center" prop="price" />
          <el-table-column label="库存" align="center" prop="quantity" />
        </el-table>

      </div>
    </el-card>
  </div>
</template>

<script>
import {  getPintuan } from "@/api/mall/promotion/pintuan";
export default {
  name: "PintuanView",
  dicts: ['mall_coupon_get_type','mall_coupon_type','mall_coupon_scope_type'],
  props: {
    activityId: {
      type: String
    }
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 查询参数
      // 表单参数
      form: {
        freeFreightFlag: 1
      },
      coupon: [], //选择的优惠券列表
      gift: [], //选择的会员列表
      promotionGoodsList: []
    };
  },
  created() {
    this._getPintuan();
  },
  methods: {
    /** 查询商城满减活动详情 */
    _getPintuan() {
      getPintuan(this.activityId).then(response => {
        this.form = response.data.pintuan;
        this.promotionGoodsList = response.data.promotionGoodsList
      });
    },
  }
};
</script>
